package controller

import (
	"github.com/cy77cc/hioshop/models"
	"github.com/cy77cc/hioshop/utils"
	"github.com/gin-gonic/gin"
	"net/http"
)

type ShowSettingHandler struct {
}

func (s *ShowSettingHandler) ShowSettings(ctx *gin.Context) {
	showSetting := models.ShowSetting{}
	res := utils.NewResponse()
	err := showSetting.GetSettings()
	if err != nil {
		res.SetRes(1, "error", nil)
		ctx.JSON(http.StatusOK, res)
		return
	}
	res.SetRes(0, "success", showSetting)
	ctx.JSON(http.StatusOK, res)
}
